Apache directory access with virtual host [SOLVED]

Posted by alexeygaidamaka on Server Fault See other posts from Server Fault or by alexeygaidamaka
Published on 2012-06-24T09:04:27Z Indexed on 2012/06/24 21:17 UTC
Read the original article Hit count: 165

Filed under:
|
|

I have a virtual host with a configuration like that.

When i'm trying to get into foobar.com/dir providing valid username/password pair i get 403 forbidden page instead of that directory contents.

www.foobar.com/dir has 777 rights, .httpaswd is chmoded 644. But i can't figure out why i am still not seeing contents. Please, give me a hint.

ServerAdmin webmaster@localhost 
ServerName www.foobar.com
ServerAlias www.foobar.com

DocumentRoot /var/www/foobar
<Directory />
    Options FollowSymLinks
    AllowOverride All       
</Directory>
<Directory /var/www/foobar>
    Options -Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>
<Directory /var/www/foobar/dir>
        AllowOverride AuthConfig
        AuthName "Authorize yourself, please!"
        AuthType Basic
        AuthUserFile /etc/apache2/.htpasswd
        AuthGroupFile /dev/null
        Allow from All
        Order Allow,Deny
            Options +Indexes<<- that one should be added                              
        Require valid-user

you have to add the line Options +Indexes to see directory contents

© Server Fault or respective owner

Related posts about apache2

Related posts about .htaccess